﻿using System;
using System.IO;

namespace GetTogether.RichText.Support
{

	
	public sealed class RtfSource : IRtfSource
	{

		
		public RtfSource( string rtf )
		{
			if ( rtf == null )
			{
				throw new ArgumentNullException( "rtf" );
			}
			reader = new StringReader( rtf );
		} // RtfSource

		
		public RtfSource( TextReader rtf )
		{
			if ( rtf == null )
			{
				throw new ArgumentNullException( "rtf" );
			}
			reader = rtf;
		} // RtfSource

		
		public RtfSource( Stream rtf )
		{
			if ( rtf == null )
			{
				throw new ArgumentNullException( "rtf" );
			}
			reader = new StreamReader( rtf, RtfSpec.AnsiEncoding );
		} // RtfSource

		
		public TextReader Reader
		{
			get { return reader; }
		} // Reader

		
		// members
		private readonly TextReader reader;

	} // class RtfSource

} 

